package com.dao.impl;

import com.bean.Admin;
import com.bean.Owner;
import com.dao.LoginDAO;
import com.util.C3p0Utils;
import org.apache.commons.dbutils.handlers.BeanHandler;

import java.sql.SQLException;

public class LoginDAOImpl implements LoginDAO {

    @Override
    public Admin Login(String name) throws SQLException {
        return C3p0Utils.qr.query("select * from admin where adminname=?",new BeanHandler<>(Admin.class),name);
    }

    @Override
    public Owner Login1(String id) throws SQLException {
        return C3p0Utils.qr.query("select * from ownermsg where ownerId=?",new BeanHandler<>(Owner.class),id);
    }
}
